#ifndef _GLOBAL_H_
#define _GLOBAL_H_

#include "./define_dx.h"
using namespace ShaderSpace;

// global variables
extern uint rand_seed;

//--------------------------------------------------------------------------------------
// Global variables
//--------------------------------------------------------------------------------------
/* manager for shared resources of dialogs */
extern CDXUTDialogResourceManager	g_DialogResourceManager;
/* A model viewing camera */
extern CModelViewerCamera				g_Camera;
/* Device settings dialog */
extern CD3DSettingsDlg					g_D3DSettingsDlg;
/* manages the 3D */
extern CDXUTDialog						g_HUD;
/* dialog for sample specific controls */
extern CDXUTDialog						g_SampleUI;

// Resources
extern CDXUTTextHelper*					g_pTxtHelper;

const DWORD MIN_DIVS = 1;
const DWORD MAX_DIVS = 64; // Min and Max divisions of the patch per side for the slider control

extern ID3D11VertexShader*                 g_pVertexShader;
extern ID3D11HullShader*                   g_pHullShaderInteger;
extern ID3D11HullShader*                   g_pHullShaderFracEven;
extern ID3D11HullShader*                   g_pHullShaderFracOdd;
// Every surface will have its own DS
#include<vector>
extern std::vector<ID3D11DomainShader*>    g_DomainShaderArray;
extern ID3D11PixelShader*                  g_pPixelShader;
extern ID3D11PixelShader*                  g_pSolidColorPS;

extern UINT                                g_iBindPerFrame;

extern ID3D11RasterizerState*              g_pRasterizerStateSolid;
extern ID3D11RasterizerState*              g_pRasterizerStateWireframe;

// Control variables
extern float                               g_fSubdivs;			// Startup subdivisions per side
extern bool                                g_bDrawWires;	// Draw the mesh with wireframe overlay

// List of defines for the shader to select which surface will be rendered
extern string								g_ParametricSurfaces[];
extern UINT									g_iNumSurfaces;				// Total Surfaces
extern UINT									g_iCurrentSurface;
extern CDXUTComboBox*					g_pSurfaceSelectionCB;		// Combo box of surfaces

extern E_PARTITION_MODE					g_iPartitionMode;

#include "./control_point.h"
extern Array<SIMPLE_CONTROL_POINT>	control_point_list;				// Control points
extern ID3D11InputLayout*				g_control_point_layout;
extern ID3D11Buffer*						control_point_list_gpu;			// Control points mapped to gpu use

#include "./constant_buffer.h"
extern ConstantBuffer							*const_buf;

#include "./shader_texture.h"
extern ShaderTexture								*tex_offset;
extern ID3D11SamplerState						*sampler_linear;
extern ShaderTexture								*tex_pos;
extern ID3D11SamplerState						*sampler_point;

extern float time_initial;
extern float time_final;

extern CDXUTComboBox						*ptrComboBox_time_anim;

extern int									time_anim_type;

extern CDXUTComboBox						*ptrComboBox_time_interpol;

extern int									time_interpol_type;

#endif
